<template>
  <el-row :gutter="30">
    <el-col :span="4"
            :class="type == 'sender' ? 'from' : 'to'"><span>{{ type == "sender" ? "发" : "收" }}</span></el-col>
    <el-col :span="20"
            class="pl-0">
      <ul>
        <li class="person0">
          <span :title="company"
                class="ellipsis">
            <Tooltip v-if="iconName"
                     :content="content"
                     :placement="placement">
              <icon-svg class-name="iconClass mr5"
                        :icon-name="iconName" />
            </Tooltip>
            {{ company }}
          </span>
        </li>
        <li class="person1">
          <span :title="`${info.province}${info.city}${info.district}${info.address}`"
                class="ellipsis">{{ info.province }}{{ info.city }}{{ info.district
            }}{{ info.address }}</span>
        </li>
        <li class="person2">
          <span :title="`${info.contactName}`">{{ info.contactName }}</span>
          {{info.contactMobile}}
        </li>
      </ul>
    </el-col>
  </el-row>
</template>

<script>
import Tooltip from "@components/basic/Tooltip.vue";
export default {
  name: "Descriptions",
  props: {
    iconName: String,
    content: String,
    placement: {
      type: String,
      default: 'top'
    },
    info: {
      type: Object,
      default: () => {
        return {
          address: "",
          cityCode: "",
          contactName: "",
          districtCode: "",
          provinceCode: ""
        };
      }
    },
    isQuote: {
      type: Boolean,
      default: false
    },
    fromTime: {
      type: String,
      value: ""
    },
    toTime: {
      type: String,
      value: ""
    },
    type: {
      type: String,
      value: "sender"
    },
    company: {
      type: String,
      value: ""
    }
  },
  components: {
    Tooltip
  },
};
</script>

<style lang="scss" scoped>
ul {
  padding: 0;
  list-style: none;
  li {
    margin-top: 10px;
  }
}
.from,
.to {
  margin-top: 12px;
  text-align: right;
  > span {
    display: inline-block;
    padding: 5px;
    height: 22px;
    text-align: center;
    width: 22px;
    border-radius: 50%;
    font-size: 16px;
    color: var(--prev-bg-white);
  }
}
.from > span {
  background-color: #2aa239;
}
.to > span {
  background-color: #e52914;
}
.pl-0 {
  padding-left: 0 !important;
}
.person0 {
  font-size: 18px;
  font-weight: bold;
  line-height: 24px;
}
.person1 {
  font-size: 16px;
  line-height: 24px;
}
.person2 {
  font-size: 14px;
  color: var(--prev-color-text-silvergrey);
  line-height: 24px;
}
.ellipsis {
  width: 100%;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.iconClass {
  width: 14px;
  height: 14px;
}
</style>
